#include"ThreadPool.hpp"
#include "Task.hpp"
#include "Log.hpp"
#include <memory>
#include<unistd.h>

using namespace ThreadPoolModule;

int main()
{
    //ENABLE_CONSOLE_LOG();
    ENABLE_FILE_LOG();

    //可以在ThreadPool.hpp中写一个宏，但是会让ThreadPool.hpp 与 Thread.hpp耦合性太强
    ThreadPool<task_t>::getInstance()->Start();

    int cnt = 15;
    while (cnt)
    {

        ThreadPool<task_t>::getInstance()->Equeue(Push);
        cnt--;
        sleep(1);
    }

    ThreadPool<task_t>::getInstance()->Stop();
    ThreadPool<task_t>::getInstance()->Wait();
}